//
//  DestinationDetailObject.m
//  HappyTrip
//
//  Created by yuxuesong on 15-3-24.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "DestinationDetailObject.h"

@implementation DestinationDetailObject

- (void)dealloc
{
    [_visited_count release];
    [_wish_to_go_count release];
    [_name release];
    [_recommended_reason release];
    [_place_description release];
    [_address release];
    [_arrival_type release];
    [_opening_time release];
    [_fee release];
    [_tel release];
    [_website release];
    [_typeNumber release];
    [_idNumber release];
    [_category release];
    [_date_added release];
    [_cover_s release];
    [_cover release];
    [_hottest_places release];
    [super dealloc];
}

- (instancetype)initWithDic:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

+ (instancetype)desDetailDic:(NSMutableDictionary *)dic
{
    DestinationDetailObject *detailObj = [[DestinationDetailObject alloc] initWithDic:dic];
    return [detailObj autorelease];
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"id"]) {
        self.idNumber = value;
    } else if ([key isEqualToString:@"description"]) {
        self.place_description = value;
    } else if ([key isEqualToString:@"type"]) {
        self.typeNumber = value;
    }
//    else {
//        [super setValue:value forUndefinedKey:key];
//    }
}
- (id)valueForUndefinedKey:(NSString *)key
{
    return nil;
}

@end
